<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:70:"E:\WWW\huzhanwang.cc\public/../application/admin\view\rule\update.html";i:1670904664;}*/ ?>


<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layuiAdmin 网站用户 iframe 框</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layuiadmin/layui/css/layui.css" media="all">
</head>
<body>
  <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
      
    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px;">
    <form>
          <input type="hidden" name="pid"  placeholder="请输入" autocomplete="off" class="layui-input" value="<?php echo $data['pid']; ?>">
          <?php if($data['pid']==0){ ?>
          <div class="layui-form-item">
              <label class="layui-form-label">栏目名称</label>
              <div class="layui-input-block">
                <input type="text" name="rule_name" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" value="<?php echo $data['rule_name']; ?>">
              </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">图标</label>
            <div class="layui-input-block">
              <input type="text" name="icon" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" value="<?php echo $data['icon']; ?>">
            </div>
        </div>
          
          <?php }else{ ?>
          <div class="layui-form-item">
            <label class="layui-form-label">栏目名称</label>
            <div class="layui-input-block">
              <input  type="text" name="rule_name" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" value="<?php echo $data['rule_name']; ?>">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">控制器</label>
            <div class="layui-input-block">
              <input  type="text" name="controller" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" value="<?php echo $data['controller']; ?>">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">方法</label>
            <div class="layui-input-block">
              <input  type="text" name="action" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" value="<?php echo $data['action']; ?>">
            </div>
          </div>
        <?php } ?>
      <div class="layui-form-item layui-hide">
          <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
      </div>
  </form>
  </div>
  <script src="/static/admin/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/static/admin/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'upload'], function(){
    var $ = layui.$
    ,form = layui.form
    ,upload = layui.upload ;
    
    upload.render({
      elem: '#layuiadmin-upload-useradmin'
      ,url: "<?php echo url('/admin/admin/upload'); ?>"
      ,auto: true //选择文件后自动上传
      // ,bindAction: '#LAY-user-front-submit'
      ,field:'image'
      ,accept: 'images'   //指定允许上传时校验的文件类型
      ,method: 'post'
      ,acceptMime: 'image/*'
      ,multiple: false  
      ,done: function(res){  //执行上传请求后的回调。返回三个参数
        $(this.item).prev("div").children("input").val(res.data)
         $('#demo1').attr('src', "/uploads/user/"+res.data); //图片链接（base64）
        layer.msg('上传成功', {
                  offset: '15px'
                  ,icon: 1
                  ,time: 1000
                });
      },error:function(res){

      }
    });

  })
  </script>
</body>
</html>